This Week's Sponsor:

Kolide

Ensures that if a device isn’t secure it can’t access your apps.  It’s Device Trust for Okta.


Search results for "%s"

Pythonista 2.0 Brings Action Extension, iPad Pro Support, Code Editor Improvements, and More

Back in the Fall of 2012, a few months after I had taken it upon myself to start moving all my work from OS X to iOS, I came across Ole Zorn’s Pythonista. A Python interpreter for iPhone and iPad that could natively integrate with iOS system features, Pythonista opened up a new world to me, demonstrating how I could automate tedious tasks on iOS devices via scripting. Since then, other apps have come along and shown how iOS tasks can be automated with visual interfaces and pre-packaged actions (above all, Workflow and Launch Center Pro), but Pythonista is, in many ways, the crown jewel of iOS automation and scripting for advanced users.

There’s nothing quite like Pythonista on iOS. As I’ve documented over the past three years, Ole Zorn has slowly but steadily extended the app’s capabilities with native ties to iOS interfaces via a UIKit bridge, support for location and the Reminders database, and even matplotlib and motion sensors. As it stands today, Pythonista is, by far, the richest and most powerful scripting app to integrate with native iOS features. Despite the variety of options now available for iOS automation and the continued evolution of iOS that cut down the number of tasks I need to automate (case in point: Split View and using two apps at once), I love keeping Pythonista around for key aspects of my workflow that can’t be automated in any other way.

For the past several months, I’ve been using version 2.0 of Pythonista on my iPhone and iPad, which, after a few rejections from Apple, has been approved and is launching today on the App Store. A free update for existing customers, Pythonista 2.0 brings a refreshed UI, support for the iPad Pro, new modules, and, more importantly, a redesigned code editor and an action extension.

Behind the scenes, Pythonista 2.0 has played an essential role in helping me assemble my reviews of iOS 9 and the iPad Pro, with an action extension I rely upon for all my image uploads, OCR, text statistics, and more.

Read more


How To Open iCloud Tabs In Editorial for iPad

Editorial iCloud Tabs

Editorial iCloud Tabs

I’ve always wanted to be able to access my iCloud Tabs directly from Editorial, but, unfortunately, due to the lack of an iCloud Tabs API, that’s currently not possible. Last week, however, when I linked to the iCloudTabs for Alfred project by Kevin Marchand and saw that the workflow was based on a bit of Python code, I realized that I could modify his script to find a way to make Editorial read constantly-updated iCloud Tabs from a text file.

What follows is a combination of a server-side script and an Editorial workflow to read and open iCloud Tabs within the app. The system works and I’ve been using it every day for the past week with good results.

Read more


A Simple “Open In Chrome” Keyboard Maestro Macro for Safari

My problem: I haven’t installed Flash on my Mac and I sometimes need to watch YouTube videos that require Flash Player in Google Chrome. Google’s browser is my Flash shelter: Safari is my main browser and I only keep Chrome around for Flash videos. I was getting annoyed by the process of copying a URL -> launching Chrome -> pasting the URL, so I made a simple Keyboard Maestro macro to automate everything with a hotkey. I don’t know what took me so long.

The macro checks if Safari is the front window, and, if not, it displays a notification with an error message. I do this to prevent accidental hotkey presses for URLs that I don’t want to open in Google Chrome. If Safari is the front window, however, what required a bunch of steps in AppleScript to open the current Safari URL in Chrome is a single action in Keyboard Maestro: Set Google Chrome URL, using %SafariURL% as a variable.

The two additional steps –  Open Chrome and Wait For Chrome To Finish Loading – were necessary because I discovered that, when launched with a Set URL action, Chrome wouldn’t intercept the URL sent by Keyboard Maestro and would simply display a blank tab. In this way, Chrome is launched, paused for a second as it reloads open tabs or the start tab, and then the Safari URL is opened in the current tab. If you want to open the URL in a new tab, change the Set Chrome URL action to New Google Chrome Tab.

You can download the macro here.


My iOS Screenshot Generation Workflow

Screenshots

Screenshots

I didn’t think that complaining about iOS status bars on The Prompt would result in Dr. Drang going on a vision quest to produce better screenshots with Python. But I’m glad that I took the time to point out my dislike for messy status bars, because it led the good Doctor to work on some great scripts to automate the entire process with Python, which are compatible with Pythonista for iOS.

I waited to share my workflow for automated screenshot cleaning/generation because I wanted to see where Dr. Drang would end up with his script, Cleanbar. Now that he appears to have settled on a solution that requires standalone image files to act as partial status bar replacements, I think it’s the right time for me to share how I produce iPhone and iPad screenshots for MacStories.

The first step is to set up Cleanbar. I don’t need to repeat what Dr. Drang already explained, but to sum up: grab a black status bar, crop it to get two files similar to Drang’s, then run a script to pack those images as strings. Once set up, you’ll be able to a) use Cleanbar to clean single images picked from the Camera Roll with Pythonista and b) integrate it as cleanbar in other scripts to clean status bars programmatically.

As for my needs:

  • I usually need to combine two iPhone screenshots side-by-side in a single image as you can see in most reviews on this site;
  • I may or may not need to clean their status bars;
  • I don’t have to combine iPad screenshots. I only need to resize them and I may or may not have to clean their status bars;
  • Occasionally, I want to produce a banner with three screenshots (like this one), which can have original or cleaned status bars;
  • Sometimes, I only need to clean one screenshot out of two;
  • I always need to upload the final image to a Dropbox folder, which is monitored by Hazel.

And, because I’m not an animal, I wanted to automate all of this. The scripts that you’ll find below are the result of late night tweaking and lots of tests; they probably aren’t the most elegant or “Pythonic” way to handle this kind of image generation, but they work for me and they make me save several minutes every day. I haven’t been generating review screenshots manually in months, and they’re more flexible than my old workflow based on Keyboard Maestro.

Read more


Automate iOS Contacts, Location Services, and Open In Menu with Pythonista 1.4

Pythonista 1.4

Pythonista 1.4

Pythonista is the app that changed my iOS workflow a year ago. A Python interpreter with native access to iOS system features like photos, URLs, and interface elements, Pythonista allowed me to convert the scripts and macros that I was using on OS X to the iPad, automating iOS in better and sometimes unexpected ways. Pythonista eventually led to Editorial, also developed by Ole Zorn, which changed the way I write and work on my iPad every day.

Pythonista 1.4, available today on the App Store, is the biggest update to Zorn’s app to date. It includes a new UI for iOS 7 (the app is also iOS 7-only starting today), new modules and enhancements to existing ones, and, more importantly, it doubles down on iOS integration by bringing native support for contacts, location, and Open In. Read more


Resolve Short URLs with Pythonista on iOS

Clean URLs

Clean URLs

I don’t like it when third-party apps or services force me to share links to articles or webpages using their own custom shortened links. I understand the appeal of personalized short domains – after all, we tweet mcstr.net links with the @macstoriesnet account – as they can provide analytics to track clicks, can save characters, and, at least in theory, they “look cool”. However, I’ve been long considering the idea of dropping our mcstr.net links, but I think the issue is worse (and more annoying) for apps and services that don’t tweet links to their own content (like we do) but that override others’ links with different domains. An example is Pocket, which gives you the clean, original URL when you choose the “Copy Link” action from the sharing menu, but that instead returns pocket.co links when sending text to Drafts (which I do often). I’ve grown tired of this practice (in Pocket and other services), and I’ve put together a workflow based on a Python script that allows me to easily resolve short links without having to open the browser and tap on multiple menus. Read more



Quickly Append Browser URLs To Evernote with Keyboard Maestro

I often come across webpages and interesting links that I can’t check out right away, but that I also don’t want to send to Instapaper, Pinboard, or my OmniFocus inbox. They are, put simply, “stuff to check out”; I append these URLs to an Evernote note carrying the same name:

Macro

Macro

As I detailed in my review of Drafts 3.0 for iOS, appending text from an iPhone or iPad is easy with Agile Tortoise’s app and a combination of Evernote actions and browser bookmarklets, but I had to think of an equally straightforward workflow for the Mac. Unfortunately, the lack of a Drafts app for OS X forced me to resort to AppleScript to achieve the same kind of functionality, but the deal was (partially) sweetened by the new features introduced in Keyboard Maestro 6.0, released back in May.

Read more


Drafts 3 Review: Better iOS Automation and Workflows

Drafts3

Drafts3

In just a little more than a year, Agile Tortoise’s Drafts has gone from being a quick notepad for small bits of text to a full-featured solution for launching apps, using web services, and chaining multiple apps together – always with a focus on text. With version 2.5, released in January, developer Greg Pierce expanded upon Drafts’ existing support for URL schemes to let users build their own actions and share them with others; in the process, he also updated Drafts to handle advanced operations such as customizable Dropbox write access, strftime timestamps, and deeper x-callback-url support.

Drafts 3.0, released today, is a major update that refines several aspects of version 2.5 and brings powerful new features such as Evernote and Message actions, better action and draft management, tighter Reminders integration, and a way to backup and restore entire sets of actions.

I have been testing Drafts 3.0 for the past month, and, even more than Drafts 2.5, it has become an essential part of my daily workflow.

Read more